package solutions.leetcode.normal;

import solutions.lib.BaseSolution;

/**
 * @author lizhidong
 * <a href="https://leetcode-cn.com/problems/single-element-in-a-sorted-array/">540. 有序数组中的单一元素</a>
 */
public class Solution540 extends BaseSolution {

    public int singleNonDuplicate(int[] nums) {
        int rst = 0;
        for (int v : nums) {
            rst ^= v;
        }
        return rst;
    }

    public static void main(String[] args) {
        Solution540 solution = new Solution540();
    }
}